#include<bits/stdc++.h>
using namespace std;
#define int long long
//int a[5005],b[5005];
class UnionFind
{
	public:
		vector<int> parent;
		vector<int> rank;
		UnionFind(int num)
		{
			parent.resize(num);
			rank.resize(num, 1);
			for (int i = 0; i < num; i++) {
				parent[i] = i;
			}
		}
		int find(int x)
		{
				if (parent[x] != x) {
				parent[x] = find(parent[x]);
			}
			return parent[x];
		}
		void unite(int x, int y )
		{
			int rootX = find(x);
			int rootY = find(y);
			if (rank[rootX] < rank[rootY]) {
				parent[rootX] = rootY;
			} else if ( rank[rootX] > rank[rootY]) {
				parent[rootY] = rootX;
			} else {
				parent[rootY] = rootX;
				rank[rootX] ++;
			}
		}
};
signed main()
{
	int n, m, p;
	cin >> n >> m >> p;
	UnionFind u(n);
	int a, b;
	for (int i = 0; i < m; i++) {
		cin >> a >> b;
		u.unite(a, b);
	}
	for (int i = 0; i < p; i++) {
		cin >> a >> b;
		if (u.find(a) == u.find(b)) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	return 0;
}
//07点10分
//07点38分
